package com.tongandtang.mq;


import org.springframework.amqp.core.Binding;
import org.springframework.amqp.core.BindingBuilder;
import org.springframework.amqp.core.DirectExchange;
import org.springframework.amqp.core.Queue;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;


@Configuration
public class DirectExchgConfig {

    /*
    // 队列
    @Bean
    public Queue directQueue(){
        // true 消息是否持久化
        return new Queue("DirectQueue",true);
    }

    // 交换机
    @Bean
    public DirectExchange directExchange(){
        return new DirectExchange("DirectExchange");
    }

    // 绑定 将队列和交换机绑定, 并设置用于匹配键：Routing
    @Bean
    public Binding bindingDirect(){
        return BindingBuilder.bind(directQueue()).to(directExchange()).with("Routing");
    }

     */
}
